/**
 * Copyright (C) 2012-2013 jumei, Inc.
 * DefaultServiceHandlerContext.java
 * 2015年6月23日
 */
package org.goface.rpc.pipeline;

/**
 * @author jm110
 */
public class DefaultServiceHandlerContext implements ServiceHandlerContext {

	protected ServicePipeLine servicePipeLine;
	protected ServiceHandler handler;
	protected String name;
	protected ServiceHandlerContext next;
	protected ServiceHandlerContext pre;

	public DefaultServiceHandlerContext(String name, ServiceHandler handler) {
		this.name = name;
		this.handler = handler;
	}

	public DefaultServiceHandlerContext(ServiceHandler handler) {
		this("", handler);

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.goface.rpc.ServiceHandlerContext#getHandler()
	 */
	@Override
	public ServiceHandler getHandler() {
		return handler;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.goface.rpc.ServiceHandlerContext#getNext()
	 */
	@Override
	public ServiceHandlerContext getNext() {
		return next;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.goface.rpc.ServiceHandlerContext#getPreviouse()
	 */
	@Override
	public ServiceHandlerContext getPreviouse() {
		return pre;
	}

	public void setNext(ServiceHandlerContext context) {
		this.next = context;

	}

	public void setPreviouse(ServiceHandlerContext context) {
		this.pre = context;

	}

	@Override
	public ServicePipeLine getPipeLine() {

		return this.servicePipeLine;
	}

	public void setPipeLine(ServicePipeLine servicePipeLine) {
		this.servicePipeLine = servicePipeLine;
	}

}
